package com.contactbook.web.server.servlet;

import java.util.List;
import java.util.Set;

import com.contactbook.web.client.dto.ContactDTO;
import com.contactbook.web.client.service.ContactService;
import com.contactbook.web.server.service.ContactServiceImpl;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class ContactServlet extends RemoteServiceServlet implements ContactService {
	
	private static final long serialVersionUID = 1L;
	
	private ContactService impl = new ContactServiceImpl();
	
	public ContactServlet() {
		super();
	}

	@Override
	public ContactDTO add(ContactDTO contact, int groupId, String login, String password) {
		return impl.add(contact, groupId, login, password);
	}

	@Override
	public ContactDTO add(ContactDTO contact, String login, String password) {
		return impl.add(contact, login, password);
	}

	@Override
	public void delete(int contactId, String login, String password) {
		impl.delete(contactId, login, password);
		
	}

	@Override
	public ContactDTO getContactById(int contactId, String login, String password) {
		return impl.getContactById(contactId, login, password);
	}

	@Override
	public Set<ContactDTO> getContacts(String login, String password) {
		return impl.getContacts(login, password);
	}

	@Override
	public Set<ContactDTO> getContacts(int groupId, String login, String password) {
		return impl.getContacts(groupId, login, password);
	}

	@Override
	public List<ContactDTO> getContactsByName(String firstName, String lastName, String login, String password) {
		return impl.getContactsByName(firstName, lastName, login, password);
	}

	@Override
	public void update(ContactDTO contact, String login, String password) {
		impl.update(contact, login, password);
	}

	@Override
	public void login(String login, String password) {
		impl.login(login, password);
	}

	@Override
	public void logout() {
		impl.logout();
	}

	@Override
	public Set<ContactDTO> getContactsWithoutGroup(String login, String password) {
		return impl.getContactsWithoutGroup(login, password);
	}

}
